package com.nt.train.config;
import com.nt.train.entity.Book;
import com.nt.train.entity.TestBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 * @author hlf
 * @version 1.0
 * @date 2022/8/15 18:25
 */
@Configuration
public class BookConfig {

    @Bean(initMethod = "myPostConstruct", destroyMethod = "myPreDestroy")
    public Book book() {
        Book book = new Book();
        book.setBookName("水浒传");
        return book;
    }

//    @Bean(initMethod = "myInit", destroyMethod = "myDestory")
//    public TestBean testBean() {
//        TestBean testBean = new TestBean();
//        testBean.setName("张三");
//        return testBean;
//    }
}